package com.api.syh56.shengyunhui.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnComment;
import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnType;
import com.gitee.sunchenbin.mybatis.actable.annotation.DefaultValue;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;


/**
 * 这是一个实体类，用于表示聊天消息的数据结构。包括消息的ID、发送者ID、接收者ID、消息内容和发送时间等信息。
 */
 
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("system_message")
public class SystemMessage {

    @Column(name = "id",isKey = true,isAutoIncrement = true,comment = "id")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Column(name = "waybill_id")
    @ColumnComment("运单id")
    private Long waybillId;

    @Column(name = "sender_id",comment = "发送人id")
    private Long senderId;

    @Column(name = "receiver_id",comment = "接收人id")
    private Long receiverId;

    @Column(name = "type",comment = "消息类型")
    private Short type;

    @Column(name = "title",comment = "消息标题")
    private String title;

    @Column(name = "content",comment = "内容")
    @ColumnType(MySqlTypeConstant.TEXT)
    private String content;

    @Column(name = "is_read",comment = "是否已读")
    private Boolean isRead;

    @TableField(fill = FieldFill.INSERT)
    @Column(name = "creation_time") // 创建时间
    private LocalDateTime creationTime;

    @Column(name = "last_modification_time") // 最后修改时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime lastModificationTime;

    @TableLogic
    @Column(name = "is_deleted")
    @DefaultValue("false")
    private Boolean isDeleted;
}